/*cnpm install express --save*/
/*cnpm install cors --save
  cnpm i nodemon -g 
  
*/

var Express = require('express')
var cors=require('cors')
var app = new Express();
var bodyParse = require('body-parser');


var userRouter=require('./router/user')
var employeeRouter = require('./router/basic/employee')
var deptRouter = require('./router/basic/dept')


app.use(cors());
app.use(bodyParse.urlencoded({ extended: false }))
app.use(bodyParse.json());


app.use('/user',userRouter);
app.use('/emp',employeeRouter);
app.use('/dept',deptRouter);


var server=app.listen('3000','localhost',function (req,res) {

    var host= server.address().address;
    var post=server.address().port;

    console.log('the server in running on http://%s:%s',host,post);

})
